package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.model.account.UserAccountDetail;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {

    // 初始化账户
    void initAccount(long parseLong);

    // 获取可用余额
    BigDecimal getAvailableAmount();
    // 检查并锁定
    AccountLockResultVo checkAndLock(AccountLockVo accountLockVo);
    // 扣减
    void minus(String parseLong);
    // 解锁
    void unlock(String orderNo);
    // 充值支付成功
    void rechargePaySuccess(String orderNo);
    // 获取充值记录
    IPage<UserAccountDetail> findUserRechargePage(Long pageNo, Long pageSize);
    // 获取消费记录
    IPage<UserAccountDetail> findUserConsumePage(Long pageNo, Long pageSize);
}
